package cz.cvut.fit.bugtrac.publicmodel.dto.graph;

import cz.cvut.fit.bugtrac.publicmodel.dto.BaseDTO;

/**
 * data transfer object for graph edge.
 * 
 * @author czebrpet
 * 
 */
public class EdgeDTO extends BaseDTO {

	private static final long serialVersionUID = 1L;

	private String name;

	private String assigner;
	private String reporter;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the reporter
	 */
	public String getReporter() {
		return reporter;
	}

	/**
	 * @param reporter
	 *            the reporter to set
	 */
	public void setReporter(String reporter) {
		this.reporter = reporter;
	}

	/**
	 * @return the assigner
	 */
	public String getAssigner() {
		return assigner;
	}

	/**
	 * @param assigner
	 *            the assigner to set
	 */
	public void setAssigner(String assigner) {
		this.assigner = assigner;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (assigner == null ? 0 : assigner.hashCode());
		result = prime * result + (name == null ? 0 : name.hashCode());
		result = prime * result + (reporter == null ? 0 : reporter.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		EdgeDTO other = (EdgeDTO) obj;
		if (assigner == null) {
			if (other.assigner != null) {
				return false;
			}
		} else if (!assigner.equals(other.assigner)) {
			return false;
		}
		if (name == null) {
			if (other.name != null) {
				return false;
			}
		} else if (!name.equals(other.name)) {
			return false;
		}
		if (reporter == null) {
			if (other.reporter != null) {
				return false;
			}
		} else if (!reporter.equals(other.reporter)) {
			return false;
		}
		return true;
	}

}
